import sun.plugin.javascript.navig.Array;

import java.util.Arrays;

/**
 * @author 汤奇
 * @version V1.0
 * @Project BookPro
 * @Package PACKAGE_NAME
 * @Description:
 * @Date 2022/7/25 17:42
 */
public class Test01 {
    public static void main(String[] args) {
        //已知两个数组a和b
        int[] a = {1,2,3,4,5,6,7,8,9};
        int[] b = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

        //把a中的部分元素复制到b中
        System.arraycopy(a,2,b,b.length-7,7);

        System.out.println(Arrays.toString(b));

        //把a数组进行扩容
        a = Arrays.copyOf(a,20);
        System.out.println(Arrays.toString(a));
    }
}
